package com.malamute.core.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;

/**
 * @author AceGuan gjybst@163.com
 * @description 标签
 * @date 2012-2-5 下午08:50:49
 * @version v1.0
 */
public class TreeTag extends ComponentTagSupport {
	private String className;
	

	/**
	 * 设置className
	 * 
	 * @param className
	 */
	public void setClassName(String className) {
		this.className = className;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @param stack
	 * 
	 * @param req
	 * 
	 * @param res
	 * 
	 * @return
	 * 
	 * @see
	 * org.apache.struts2.views.jsp.ComponentTagSupport#getBean(com.opensymphony
	 * .xwork2.util.ValueStack, javax.servlet.http.HttpServletRequest,
	 * javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public Component getBean(ValueStack stack, HttpServletRequest req,
			HttpServletResponse res) {
		TreeComponent treeComponent = new TreeComponent(stack);
		treeComponent.setReq(req);
		return treeComponent;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.struts2.views.jsp.ComponentTagSupport#populateParams()
	 */
	@Override
	protected void populateParams() {
		super.populateParams();
		TreeComponent treeComponent = (TreeComponent) component;
		treeComponent.setClassName(className);

	}

}
